package com.shiro.common.entity;

import com.shiro.common.entity.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: dengpeng
 * Date: 2018/7/5
 * Time: 11:04
 * Description: 权限
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "permission")
public class Permission extends BaseEntity {

    /**url*/
    private String url;

    /**角色*/
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "role_permission",
                    joinColumns = {@JoinColumn(name = "permission_id")},
                    inverseJoinColumns = {@JoinColumn(name = "role_id")})
    private List<Role> roleList;
}
